<template>
  <div class="case_register_main_box" v-if="!loading">
    <div class="case_register_main">

      <div class="step_bar">
        <div class="step_bar_item"
             :class="currStep===i?'curr_step':''"
             v-for="i in 4"
             @click="false&&gotoStep(i)">
          <div class="step_bar_label" style="color: white">{{stepObj[i]}}</div>
          <div class="step_bar_num" :class="currStep===i?'curr_step':''" style="background: #ffffff;">{{i}}</div>
        </div>
      </div>


      <div class="step1" v-if="currStep===1" tabindex="0">
        <div class="box">
          <div style="display: inline-block">
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="24">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>单&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;位：
                  </div>
                  <select-tree v-model="djrxx.unit" @selected="checkValue('unit')" class="select"
                               id="unit"
                               :tree-data="unitData"
                               :field="unitField"></select-tree>
                  <div class="error" :title="errors.unit" :style="errors.unit?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="24">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>用&nbsp;&nbsp;户&nbsp;&nbsp;名：
                  </div>
                  <el-input size="mini" id="username" @input="checkValue('username')" class="input"
                            v-model="djrxx.username"></el-input>
                  <!--<input id="username" v-model="djrxx.username" type="text" class="input"-->
                  <!--@input="checkValue('username')">-->
                  <div class="error" :title="errors.username"
                       :style="errors.username?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="24">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码：
                  </div>
                  <el-input size="mini" id="userpsd" @input="checkValue('userpsd')" onpaste="return false" class="input"
                            type="password" v-model="djrxx.userpsd"></el-input>
                  <!--<input id="userpsd" v-model="djrxx.userpsd" type="password" class="input"-->
                  <!--@input="checkValue('userpsd')"-->
                  <!--onpaste="return false">-->
                  <div class="error" :title="errors.userpsd"
                       :style="errors.userpsd?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="24">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>确认密码：
                  </div>
                  <el-input size="mini" id="passwordAgain" @input="checkValue('passwordAgain')" onpaste="return false"
                            class="input"
                            type="password" v-model="djrxx.passwordAgain"></el-input>
                  <!--<input id="passwordAgain" v-model="djrxx.passwordAgain" type="password" class="input"-->
                  <!--@input="checkValue('passwordAgain')"-->
                  <!--onpaste="return false">-->
                  <div class="error" :title="errors.passwordAgain"
                       :style="errors.passwordAgain?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <div class="btn_box">
              <button class="btn" @click="gotoStep(currStep+1)">下一步</button>
            </div>
          </div>
        </div>
      </div>

      <div class="step2" v-if="currStep===2">
        <div class="box">
          <div class="scroll_bar" style="display: inline-block;width: 100%;height: calc(100% - 50px)">
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>部门受案号：
                  </div>
                  <el-input size="mini" id="bmsah" @input="checkValue('bmsah')" class="input"
                            v-model="ajjbxxData.bmsah"></el-input>
                  <!--<input type="text" class="input" id="bmsah" v-model="ajjbxxData.bmsah"-->
                  <!--@input="checkValue('bmsah')">-->
                  <div class="error" :title="errors.bmsah"
                       :style="errors.bmsah?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>统一受案号：
                  </div>
                  <el-input size="mini" id="tysah" @input="checkValue('tysah')" class="input"
                            v-model="ajjbxxData.tysah"></el-input>
                  <!--<input type="text" class="input" id="tysah" v-model="ajjbxxData.tysah"-->
                  <!--@input="checkValue('tysah')">-->
                  <div class="error" :title="errors.tysah"
                       :style="errors.tysah?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>

            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>承办单位：
                  </div>
                  <select-tree v-model="ajjbxxData.cbdw" @selected="checkValue('cbdw')" class="select"
                               id="cbdw" :tree-data="unitData"
                               :field="unitField"></select-tree>
                  <div class="error" :title="errors.cbdw"
                       :style="errors.cbdw?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>受理日期：
                  </div>
                  <!--<el-date-picker-->
                  <!--v-model="ajjbxxData.slrq"-->
                  <!--type="date"-->
                  <!--id="slrq"-->
                  <!--@change="checkValue('slrq')"-->
                  <!--:editable="false"-->
                  <!--class="input"-->
                  <!--value-format="yyyy-MM-dd"-->
                  <!--placeholder="选择日期">-->
                  <!--</el-date-picker>-->

                  <!--<el-input size="mini" id="slrq" @change="checkValue('slrq')" class="input" v-model="ajjbxxData.slrq"></el-input>-->
                  <input type="date" class="input" id="slrq" v-model="ajjbxxData.slrq"
                         @change="checkValue('slrq')">
                  <div class="error" :title="errors.slrq"
                       :style="errors.slrq?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>


            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>案件名称：
                  </div>
                  <el-input size="mini" id="ajmc" @input="checkValue('ajmc')" class="input"
                            v-model="ajjbxxData.ajmc"></el-input>
                  <!--<input type="text" class="input" id="ajmc" v-model="ajjbxxData.ajmc"-->
                  <!--@input="checkValue('ajmc')">-->
                  <div class="error" :title="errors.ajmc"
                       :style="errors.ajmc?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>案件类别：
                  </div>
                  <!--{{ajlbSelections}}-->
                  <!--<el-select filterable id="ajlb_bm" @change="checkValue('ajlb_bm')" v-model="ajjbxxData.ajlb_bm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in ajlbSelections"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="ajlb_bm" v-model="ajjbxxData.ajlb_bm"
                          @change="checkValue('ajlb_bm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in ajlbSelections">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.ajlb_bm"
                       :style="errors.ajlb_bm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">承办部门：</div>
                  <el-input size="mini" id="cbbm_mc" @input="checkValue('cbbm_mc')" class="input"
                            v-model="ajjbxxData.cbbm_mc"></el-input>
                  <!--<input type="text" class="input" id="cbbm_mc" v-model="ajjbxxData.cbbm_mc"-->
                  <!--@input="checkValue('cbbm_mc')">-->
                  <div class="error" :title="errors.cbbm_mc"
                       :style="errors.cbbm_mc?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">承办人：</div>
                  <el-input size="mini" id="cbr" @input="checkValue('cbr')" class="input"
                            v-model="ajjbxxData.cbr"></el-input>
                  <!--<input type="text" class="input" id="cbr" v-model="ajjbxxData.cbr"-->
                  <!--@input="checkValue('cbr')">-->
                  <div class="error" :title="errors.cbr"
                       :style="errors.cbr?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">侦查机关：</div>
                  <!--<el-select filterable id="zcjg_dwdm" @change="checkValue('zcjg_dwdm')" v-model="ajjbxxData.zcjg_dwdm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in zcjg_dwdm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="zcjg_dwdm" v-model="ajjbxxData.zcjg_dwdm"
                          @change="checkValue('zcjg_dwdm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in zcjg_dwdm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.zcjg_dwdm"
                       :style="errors.zcjg_dwdm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">移送单位：</div>
                  <select-tree v-model="ajjbxxData.ysdw" @selected="checkValue('ysdw')" class="select"
                               id="ysdw" :tree-data="unitData"
                               :field="unitField"></select-tree>
                  <div class="error" :title="errors.ysdw"
                       :style="errors.ysdw?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">移送文书文号：</div>
                  <el-input size="mini" id="yswswh" @input="checkValue('yswswh')" class="input"
                            v-model="ajjbxxData.yswswh"></el-input>
                  <!--<input type="text" class="input" id="yswswh" v-model="ajjbxxData.yswswh"-->
                  <!--@input="checkValue('yswswh')">-->
                  <div class="error" :title="errors.yswswh"
                       :style="errors.yswswh?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">移送案由：</div>
                  <!--<el-select filterable id="ysay_aydm" @change="checkValue('ysay_aydm')" v-model="ajjbxxData.ysay_aydm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in ay"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="ysay_aydm" v-model="ajjbxxData.ysay_aydm"
                          @change="checkValue('ysay_aydm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in ay">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.ysay_aydm"
                       :style="errors.ysay_aydm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">移送其他案由：</div>
                  <!--<el-select filterable id="ysqtay_aydms" @change="checkValue('ysqtay_aydms')"-->
                  <!--v-model="ajjbxxData.ysqtay_aydms"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in ay"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="ysqtay_aydms" v-model="ajjbxxData.ysqtay_aydms"
                          @change="checkValue('ysqtay_aydms')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in ay">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.ysqtay_aydms"
                       :style="errors.ysqtay_aydms?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">涉外案件：</div>
                  <!--<el-select filterable id="sfswaj" @change="checkValue('sfswaj')" v-model="ajjbxxData.sfswaj"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in defaultSelection"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="sfswaj" v-model="ajjbxxData.sfswaj"
                          @change="checkValue('sfswaj')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in defaultSelection">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.sfswaj"
                       :style="errors.sfswaj?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">督办案件：</div>
                  <!--<el-select filterable id="sfdbaj" @change="checkValue('sfdbaj')" v-model="ajjbxxData.sfdbaj"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in defaultSelection"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="sfdbaj" v-model="ajjbxxData.sfdbaj"
                          @change="checkValue('sfdbaj')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in defaultSelection">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.sfdbaj"
                       :style="errors.sfdbaj?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">关注案件：</div>
                  <!--<el-select filterable id="sfgzaj" @change="checkValue('sfgzaj')" v-model="ajjbxxData.sfgzaj"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in defaultSelection"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="sfgzaj" v-model="ajjbxxData.sfgzaj"
                          @change="checkValue('sfgzaj')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in defaultSelection">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.sfgzaj"
                       :style="errors.sfgzaj?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="24">
                <div class="item" style="width: 100%">
                  <div class="label">案情摘要：</div>
                  <el-input size="mini" id="aqzy" @input="checkValue('aqzy')" resize="none" :rows="5" type="textarea"
                            class="textarea"
                            v-model="ajjbxxData.aqzy"></el-input>
                  <!--<textarea class="textarea" id="aqzy" v-model="ajjbxxData.aqzy"-->
                  <!--@input="checkValue('aqzy')"></textarea>-->
                  <div class="error" :title="errors.aqzy" style="margin-top: 52px;"
                       :style="errors.aqzy?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
          </div>
          <div class="btn_box">
            <button class="btn" @click="currStep--">上一步</button>
            <button class="btn" @click="gotoStep(currStep+1)">下一步</button>
          </div>
        </div>
      </div>

      <div class="step3" v-if="currStep===3">
        <div class="box">
          <div style="border-bottom: 1px solid #d1d9dd;padding-bottom: 10px">
            <div class="first" title="第一页" @click="xyrxxDataIndex!==0&&changeXyrPage(0)"></div>
            <div class="prev" title="上一页" @click="xyrxxDataIndex>0?changeXyrPage(xyrxxDataIndex-1):''"></div>
            <span
              style="font-size: 14px;vertical-align: top;color:#666;">共 {{ xyrxxData.length }} 条记录，当前为第 {{ xyrxxDataIndex + 1 }} 条记录</span>
            <div class="next" title="下一页"
                 @click="xyrxxDataIndex<xyrxxData.length-1?changeXyrPage(xyrxxDataIndex+1):''"></div>
            <div class="last" title="最后一页"
                 @click="xyrxxDataIndex!==xyrxxData.length-1&&changeXyrPage(xyrxxData.length-1)"></div>
            <div class="add" title="新增一页" @click="addXyr"></div>
            <div class="del" title="删除当前页" @click="delXyr"></div>
          </div>
          <!--<div style="display: inline-block">-->
          <div class="scroll_bar" style="overflow: auto;height: calc(100% - 20px);margin-bottom: 10px">
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <!--<div class="item">-->
                  <!--<div class="label">案件名称：</div>-->
                  <!--<el-input size="mini" id="ajmc" @input="checkValue('ajmc')" class="input" v-model="ajjbxxData.ajmc"></el-input>-->
                  <!--&lt;!&ndash;<input type="text" class="input" id="ajmc" v-model="ajjbxxData.ajmc"&ndash;&gt;-->
                  <!--&lt;!&ndash;@input="checkValue('ajmc')">&ndash;&gt;-->
                  <!--<div class="error" :title="errors.ajmc"-->
                  <!--:style="errors.ajmc?'':'visibility: hidden'"></div>-->
                  <!--</div>-->
                  <div class="label">
                    <span class="required">*</span>案件名称：
                  </div>
                  <el-input size="mini" class="input" disabled @input="checkValue('ajmc')"
                            v-model="ajjbxxData.ajmc"></el-input>
                  <!--<input type="text"-->
                  <!--style="cursor: not-allowed;" class="input" readonly disabled v-model="ajjbxxData.bmsah"-->
                  <!--@input="checkValue('bmsah')">-->
                  <div class="error" :title="errors.ajmc"
                       :style="errors.ajmc?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>部门受案号：
                  </div>
                  <el-input size="mini" class="input" disabled @input="checkValue('bmsah')"
                            v-model="ajjbxxData.bmsah"></el-input>
                  <!--<input type="text"-->
                  <!--style="cursor: not-allowed;" class="input" readonly disabled v-model="ajjbxxData.bmsah"-->
                  <!--@input="checkValue('bmsah')">-->
                  <div class="error" :title="errors.bmsah"
                       :style="errors.bmsah?'':'visibility: hidden'"></div>
                  <!--<div class="label">犯罪嫌疑人编号：</div>-->
                  <!--<el-input size="mini" id="xyrbh" @input="checkValue('xyrbh')" class="input"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].xyrbh"></el-input>-->
                  <!--&lt;!&ndash;<input type="text" class="input" id="xyrbh" v-model="xyrxxData[xyrxxDataIndex].xyrbh"&ndash;&gt;-->
                  <!--&lt;!&ndash;@input="checkValue('xyrbh')">&ndash;&gt;-->
                  <!--<div class="error" :title="errors.xyrbh"-->
                  <!--:style="errors.xyrbh?'':'visibility: hidden'"></div>-->
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>姓名：
                  </div>
                  <el-input size="mini" id="xm" @input="checkValue('xm')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].xm"></el-input>
                  <!--<input type="text" class="input" id="xm" v-model="xyrxxData[xyrxxDataIndex].xm"-->
                  <!--@input="checkValue('xm')">-->
                  <div class="error" :title="errors.xm"
                       :style="errors.xm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">
                    <span class="required">*</span>是否主犯：
                  </div>
                  <!--<el-select filterable id="sfzf" @change="checkValue('sfzf')" v-model="xyrxxData[xyrxxDataIndex].sfzf"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in defaultSelection"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="sfzf" v-model="xyrxxData[xyrxxDataIndex].sfzf"
                          @change="checkValue('sfzf')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in defaultSelection">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.sfzf"
                       :style="errors.sfzf?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">曾用名：</div>
                  <el-input size="mini" id="cym" @input="checkValue('cym')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].cym"></el-input>
                  <!--<input type="text" class="input" id="cym" v-model="xyrxxData[xyrxxDataIndex].cym"-->
                  <!--@input="checkValue('cym')">-->
                  <div class="error" :title="errors.cym"
                       :style="errors.cym?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">绰号：</div>
                  <el-input size="mini" id="ch" @input="checkValue('ch')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].ch"></el-input>
                  <!--<input type="text" class="input" id="ch" v-model="xyrxxData[xyrxxDataIndex].ch"-->
                  <!--@input="checkValue('ch')">-->
                  <div class="error" :title="errors.ch"
                       :style="errors.ch?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">证件类型：</div>
                  <!--<el-select filterable id="zjlx_dm" @change="checkValue('zjlx_dm')"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].zjlx_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in zjlx_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="zjlx_dm" v-model="xyrxxData[xyrxxDataIndex].zjlx_dm"
                          @change="checkValue('zjlx_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in zjlx_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.zjlx_dm"
                       :style="errors.zjlx_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">证件号码：</div>
                  <el-input size="mini" id="zjhm" @input="checkValue('zjhm')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].zjhm"></el-input>
                  <!--<input type="text" class="input" id="zjhm" v-model="xyrxxData[xyrxxDataIndex].zjhm"-->
                  <!--@input="checkValue('zjhm')">-->
                  <div class="error" :title="errors.zjhm"
                       :style="errors.zjhm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">性别：</div>
                  <!--<el-select filterable id="xb_dm" @change="checkValue('xb_dm')" v-model="xyrxxData[xyrxxDataIndex].xb_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in xb_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="xb_dm" v-model="xyrxxData[xyrxxDataIndex].xb_dm"
                          @change="checkValue('xb_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in xb_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.xb_dm"
                       :style="errors.xb_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">民族：</div>
                  <!--<el-select filterable id="mz_dm" @change="checkValue('mz_dm')" v-model="xyrxxData[xyrxxDataIndex].mz_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in mz_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="mz_dm" v-model="xyrxxData[xyrxxDataIndex].mz_dm"
                          @change="checkValue('mz_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in mz_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.mz_dm"
                       :style="errors.mz_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">出生日期：</div>
                  <!--<el-date-picker-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].csrq"-->
                  <!--type="date"-->
                  <!--id="csrq"-->
                  <!--@change="checkValue('csrq')"-->
                  <!--:editable="false"-->
                  <!--class="input"-->
                  <!--value-format="yyyy-MM-dd"-->
                  <!--placeholder="选择日期">-->
                  <!--</el-date-picker>-->
                  <!--<el-input size="mini" id="csrq" @change="checkValue('csrq')" class="input"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].csrq"></el-input>-->
                  <input type="date" class="input" id="csrq" v-model="xyrxxData[xyrxxDataIndex].csrq"
                         @change="checkValue('csrq')">
                  <div class="error" :title="errors.csrq"
                       :style="errors.csrq?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">作案时年龄：</div>
                  <el-input size="mini" id="zasnl" @input="checkValue('zasnl')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].zasnl"></el-input>
                  <!--<input type="number" min="0" max="100" class="input" id="zasnl"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].zasnl"-->
                  <!--@input="checkValue('zasnl')">-->
                  <div class="error" :title="errors.zasnl"
                       :style="errors.zasnl?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">国籍：</div>
                  <!--<el-select filterable id="gj_dm" @change="checkValue('gj_dm')" v-model="xyrxxData[xyrxxDataIndex].gj_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in gj_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="gj_dm" v-model="xyrxxData[xyrxxDataIndex].gj_dm"
                          @change="checkValue('gj_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in gj_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.gj_dm"
                       :style="errors.gj_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">出生地：</div>
                  <select-tree v-model="xyrxxData[xyrxxDataIndex].csd" @selected="checkValue('csd')"
                               class="select" id="csd" :tree-data="dq"
                               :expand-on-click="true"
                               :field="dqField"></select-tree>
                  <div class="error" :title="errors.csd"
                       :style="errors.csd?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">户籍所在地：</div>
                  <select-tree v-model="xyrxxData[xyrxxDataIndex].hjszd" @selected="checkValue('hjszd')"
                               class="select" id="hjszd" :tree-data="dq"
                               :expand-on-click="true"
                               :field="dqField"></select-tree>
                  <div class="error" :title="errors.hjszd"
                       :style="errors.hjszd?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">住所地：</div>
                  <select-tree v-model="xyrxxData[xyrxxDataIndex].zsd" @selected="checkValue('zsd')"
                               class="select" id="zsd" :tree-data="dq"
                               :expand-on-click="true"
                               :field="dqField"></select-tree>
                  <div class="error" :title="errors.zsd"
                       :style="errors.zsd?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="24">
                <div class="item" style="width: 100%">
                  <div class="label">住所地详细地址：</div>
                  <el-input size="mini" id="zsdxxdz" @input="checkValue('zsdxxdz')" class="input"
                            style="width: calc(100% - 195px)"
                            v-model="xyrxxData[xyrxxDataIndex].zsdxxdz"></el-input>
                  <!--<input type="text" class="input" style="width: calc(100% - 191px)"-->
                  <!--id="zsdxxdz" v-model="xyrxxData[xyrxxDataIndex].zsdxxdz"-->
                  <!--@input="checkValue('zsdxxdz')">-->
                  <div class="error" :title="errors.zsdxxdz"
                       :style="errors.zsdxxdz?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">工作单位：</div>
                  <el-input size="mini" id="gzdw" @input="checkValue('gzdw')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].gzdw"></el-input>
                  <!--<input type="text" class="input" id="gzdw" v-model="xyrxxData[xyrxxDataIndex].gzdw"-->
                  <!--@input="checkValue('gzdw')">-->
                  <div class="error" :title="errors.gzdw"
                       :style="errors.gzdw?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">工作单位所在地：</div>
                  <select-tree v-model="xyrxxData[xyrxxDataIndex].gzdwszd"
                               @selected="checkValue('gzdwszd')" class="select" id="gzdwszd" :tree-data="dq"
                               :expand-on-click="true"
                               :field="dqField"></select-tree>
                  <div class="error" :title="errors.gzdwszd"
                       :style="errors.gzdwszd?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">职级：</div>
                  <!--<el-select filterable id="zj_dm" @change="checkValue('zj_dm')" v-model="xyrxxData[xyrxxDataIndex].zj_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in zj_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="zj_dm" v-model="xyrxxData[xyrxxDataIndex].zj_dm"
                          @change="checkValue('zj_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in zj_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.zj_dm"
                       :style="errors.zj_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">职务：</div>
                  <el-input size="mini" id="zw" @input="checkValue('zw')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].zw"></el-input>
                  <!--<input type="text" class="input" id="zw" v-model="xyrxxData[xyrxxDataIndex].zw"-->
                  <!--@input="checkValue('zw')">-->
                  <div class="error" :title="errors.zw"
                       :style="errors.zw?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">职业：</div>
                  <!--<el-select filterable id="zy_dm" @change="checkValue('zy_dm')" v-model="xyrxxData[xyrxxDataIndex].zy_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in zy_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="zy_dm" v-model="xyrxxData[xyrxxDataIndex].zy_dm"
                          @change="checkValue('zy_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in zy_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.zy_dm"
                       :style="errors.zy_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">身份：</div>
                  <!--<el-select filterable id="sf_dm" @change="checkValue('sf_dm')" v-model="xyrxxData[xyrxxDataIndex].sf_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in sf_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="sf_dm" v-model="xyrxxData[xyrxxDataIndex].sf_dm"
                          @change="checkValue('sf_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in sf_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.sf_dm"
                       :style="errors.sf_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">受教育状况：</div>
                  <!--<el-select filterable id="sjyzk_dm" @change="checkValue('sjyzk_dm')"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].sjyzk_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in sjyzk_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="sjyzk_dm" v-model="xyrxxData[xyrxxDataIndex].sjyzk_dm"
                          @change="checkValue('sjyzk_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in sjyzk_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.sjyzk_dm"
                       :style="errors.sjyzk_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">政治面貌：</div>
                  <!--<el-select filterable id="zzmm_dm" @change="checkValue('zzmm_dm')"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].zzmm_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in zzmm_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="zzmm_dm" v-model="xyrxxData[xyrxxDataIndex].zzmm_dm"
                          @change="checkValue('zzmm_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in zzmm_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.zzmm_dm"
                       :style="errors.zzmm_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">人大代表：</div>
                  <!--<el-select filterable id="rddb_dm" @change="checkValue('rddb_dm')"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].rddb_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in rddb_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="rddb_dm" v-model="xyrxxData[xyrxxDataIndex].rddb_dm"
                          @change="checkValue('rddb_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in rddb_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.rddb_dm"
                       :style="errors.rddb_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">政协委员：</div>
                  <!--<el-select filterable id="zxwy_dm" @change="checkValue('zxwy_dm')"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].zxwy_dm"-->
                  <!--placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in zxwy_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="zxwy_dm" v-model="xyrxxData[xyrxxDataIndex].zxwy_dm"
                          @change="checkValue('zxwy_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in zxwy_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.zxwy_dm"
                       :style="errors.zxwy_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">农村基层组织人员：</div>
                  <!--<el-select filterable id="sfncjczzry" @change="checkValue('sfncjczzry')"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].sfncjczzry" placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in defaultSelection"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="sfncjczzry" v-model="xyrxxData[xyrxxDataIndex].sfncjczzry"
                          @change="checkValue('sfncjczzry')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in defaultSelection">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.sfncjczzry"
                       :style="errors.sfncjczzry?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">未成年人监护情况：</div>
                  <!--<el-select filterable id="wcnrjhqk_dm" @change="checkValue('wcnrjhqk_dm')"-->
                  <!--v-model="xyrxxData[xyrxxDataIndex].wcnrjhqk_dm" placeholder="请选择">-->
                  <!--<el-option key="" label="请选择" value="">-->
                  <!--</el-option>-->
                  <!--<el-option-->
                  <!--v-for="item in wcnrjhqk_dm"-->
                  <!--:key="item.dm"-->
                  <!--:label="item.mc"-->
                  <!--:value="item.dm">-->
                  <!--</el-option>-->
                  <!--</el-select>-->
                  <select class="input" id="wcnrjhqk_dm" v-model="xyrxxData[xyrxxDataIndex].wcnrjhqk_dm"
                          @change="checkValue('wcnrjhqk_dm')">
                    <option value="">请选择</option>
                    <option :value="item.dm" v-for="item in wcnrjhqk_dm">{{item.mc}}</option>
                  </select>
                  <div class="error" :title="errors.wcnrjhqk_dm"
                       :style="errors.wcnrjhqk_dm?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
            <el-row type="flex" class="row-bg">
              <el-col class="row_col" :span="12">
                <div class="item">
                  <div class="label">法定代理人：</div>
                  <el-input size="mini" id="fddlr" @input="checkValue('fddlr')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].fddlr"></el-input>
                  <!--<input type="text" class="input" id="fddlr" v-model="xyrxxData[xyrxxDataIndex].fddlr"-->
                  <!--@input="checkValue('fddlr')">-->
                  <div class="error" :title="errors.fddlr"
                       :style="errors.fddlr?'':'visibility: hidden'"></div>
                </div>
              </el-col>
              <el-col class="row_col" :span="12" align="right">
                <div class="item">
                  <div class="label">所在学校名称：</div>
                  <el-input size="mini" id="szxxmc" @input="checkValue('szxxmc')" class="input"
                            v-model="xyrxxData[xyrxxDataIndex].szxxmc"></el-input>
                  <!--<input type="text" class="input" id="szxxmc" v-model="xyrxxData[xyrxxDataIndex].szxxmc"-->
                  <!--@input="checkValue('szxxmc')">-->
                  <div class="error" :title="errors.szxxmc"
                       :style="errors.szxxmc?'':'visibility: hidden'"></div>
                </div>
              </el-col>
            </el-row>
          </div>
          <div class="btn_box">
            <button class="btn" @click="currStep--">上一步</button>
            <button class="btn" @click="gotoStep(currStep+1)">下一步</button>
          </div>
          <!--</div>-->
        </div>
      </div>

      <div class="step4" v-if="currStep===4">
        <div class="box">
          <div class="bar">
            <div :class="selectDossierType===dossierType.electronicDossier?'selected':''"
                 @click="switchType(dossierType.electronicDossier)">电子卷宗
            </div>
            <div :class="selectDossierType===dossierType.documentDossier?'selected':''"
                 @click="switchType(dossierType.documentDossier)">文书卷宗
            </div>
            <!--<div :class="selectDossierType===dossierType.otherFile?'selected':''"-->
            <!--@click="switchType(dossierType.otherFile)">其他文件-->
            <!--</div>-->
          </div>
          <div class="title">
            <button class="upload" @click="upload">
              <div class="img"></div>
              <span class="label">上传</span>
            </button>
            <button class="newdir" @click="newDir">
              <div class="img"></div>
              <span class="label">新建文件夹</span>
            </button>
            <button class="rename" @click="rename(selections[0],$event)" v-if="selections.length===1">
              <div class="img"></div>
              <span class="label">重命名</span>
            </button>
            <button class="del" @click="deleteSelected" v-if="selections.length">
              <div class="img"></div>
              <span class="label">删除</span>
            </button>
            <div class="search">
              <input type="text" class="input" @input="search" placeholder="输入关键字进行检索">
              <img src="~@/assets/img/ajdj/search.png"/>
            </div>
          </div>
          <div class="nav">
            <span @click="prevLevel">返回上一级</span>
            <span style="color: #666;cursor: default;margin: 0 5px">|</span>
            <span @click="gotoLevel(defaultId,1)">全部文件</span>
            <span @click="gotoLevel(item.pid,item.deepth)" v-for="(item,index) in navData[selectDossierType]"
                  :style="index===navData[selectDossierType].length-1?'color:#666;cursor: default;':''"><span
              style="color: #666;cursor: default;font-size: 14px;margin: 0 5px">&gt;</span>{{item.name}}</span>
          </div>
          <div class="fileContent"
               @keydown.delete.stop="deleteSelected"
               @keydown.f2.stop="rename(selections[selections.length-1],$event)"
               tabindex="0">
            <el-table :data="currZjclData"
                      style="width: 100%;height:100%"
                      tooltip-effect="dark"
                      ref="zjclTable"
                      @row-dblclick="open"
                      @row-click="rowClick"
                      empty-text="暂无数据"
                      :cell-style="cellStyle"
                      :row-style="rowStyle"
                      @selection-change="selectionChange"
                      :header-cell-style="cellStyle"
                      @row-contextmenu="contextmenu">
              <el-table-column type="selection" width="55">
              </el-table-column>
              <el-table-column prop="name" label="文件名" show-overflow-tooltip>
                <template slot-scope="scope">
                  <img v-if="scope.row.type==='dir'" src="~@/assets/img/ajdj/wenjianjia.png"
                       class="icon">
                  <img v-else src="~@/assets/img/ajdj/f.png"
                       class="icon"/>
                  <span @dblclick.stop="rename(scope.row,$event)"
                        :id="scope.row.id"
                        class="name_list"
                        style="cursor: default;display: inline-block;padding-left: 10px;padding-right: 10px"
                        @keydown.stop.prevent.enter="saveName(scope.row,$event)"
                        @blur="saveName(scope.row,$event)">
                  {{scope.row.name}}
                </span>
                </template>
              </el-table-column>
              <el-table-column prop="fileSize" label="大小" width="120" align="right">
              </el-table-column>
              <el-table-column prop="type" label="类型" width="120">
                <template slot-scope="scope">{{ scope.row.type==='dir'?'文件夹':scope.row.type+'文件' }}</template>
              </el-table-column>
              <el-table-column prop="uploadDate" label="上传日期" width="160" sortable :sort-method="sortByUpdate">
              </el-table-column>
              <el-table-column prop="uploadStatus" label="状态" width="80" sortable :sort-method="sortByStatus"
                               align="center">
                <template slot-scope="scope">
                  <!--文件状态-->
                  <i class="el-icon-loading" style="vertical-align: baseline;"
                     v-if="scope.row.type!=='dir'&&scope.row.uploadStatus===0" title="上传中"></i>
                  <i class="el-icon-success" v-if="scope.row.type!=='dir'&&scope.row.uploadStatus===1" title="上传成功"
                     style="color: #409EFF;vertical-align: baseline;"></i>
                  <i class="el-icon-error" v-if="scope.row.type!=='dir'&&scope.row.uploadStatus===2" title="上传失败，点击重试"
                     style="color: red;vertical-align: baseline;"
                     @click.stop="uploadRetry(scope.row,$event)"></i>
                  <!--文件夹状态-->
                  <i class="el-icon-loading" style="vertical-align: baseline;"
                     v-if="scope.row.type==='dir'&&getUploadStatus(scope.row)===0"
                     title="上传中"></i>
                  <i class="el-icon-success" v-if="scope.row.type==='dir'&&getUploadStatus(scope.row)===1" title="上传成功"
                     style="color: #409EFF;vertical-align: baseline;"></i>
                  <i class="el-icon-error" v-if="scope.row.type==='dir'&&getUploadStatus(scope.row)===2"
                     title="内有文件上传失败"
                     style="color: red;vertical-align: baseline;"></i>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div class="file_count"> {{fileCount}}个文件 {{dirCount}}个文件夹</div>
          <div class="btn_box">
            <button class="btn" @click="currStep--">上一步</button>
            <button class="btn" @click="done">保存</button>
          </div>
        </div>
      </div>
    </div>

    <pre-zjcl class="pre_zjcl" :inline="false" v-if="preZjclShow" @hide="preZjclShow=false" ref="preZjcl"></pre-zjcl>
  </div>
</template>

<script>
  import { mapState } from 'vuex'
  import SQLite from '../common/SQLiteHelper'

  let remote = ''

  const uuid = require('uuid/v4')
  const fs = require('fs')
  const path = require('path')
  const moment = require('moment')
  const crypto = require('crypto')
  const { SYSTEM: { UNIT_DATA } } = require('../common/config').default
  /* eslint-disable camelcase */
  const {
    util: { isNotEmpty, copyFile, copyFileSync, getTreeDataSource },
    quantity: { extStrRE },
    sql: {
      getSql: {
        get_insert_ajjbxx_variable_sql,
        get_insert_user_variable_sql,
        get_insert_xyrjbxx_variable_sql,
        get_insert_dzjzml_variable_sql,
        get_insert_dzjzmlwj_variable_sql,
        get_insert_dzjztpl_variable_sql,
        get_insert_wsjzml_variable_sql,
        get_insert_wsjzmlwj_variable_sql,
        get_insert_wsjztpl_variable_sql
      }
    },
    CMD: { openDirOrFile }
  } = require('../util')

  const staticPath = remote ? remote.getGlobal('staticPath') : ''

  let execDir = path.dirname(process.execPath)

  let uploadList = []

  let unitData = []
  let dqData = []

  // const IDCARDRE = /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/

  const lb = {
    '': '案件类别',
    zcjg_dwdm: { bm: 9901, name: '侦察机关' },
    ay: { bm: 9903, name: '移送案由' },
    xb_dm: { bm: 9909, name: '性别' },
    zjlx_dm: { bm: 9910, name: '证件类型' },
    gj_dm: { bm: 9911, name: '国籍' },
    mz_dm: { bm: 9912, name: '民族' },
    dq: { bm: 9913, name: '地区' },
    zj_dm: { bm: 9914, name: '职级' },
    sjyzk_dm: { bm: 9915, name: '受教育状况' },
    sf_dm: { bm: 9916, name: '身份' },
    zzmm_dm: { bm: 9917, name: '政治面貌' },
    rddb_dm: { bm: 9918, name: '人大代表' },
    zxwy_dm: { bm: 9919, name: '政协委员' },
    wcnrjhqk_dm: { bm: 9920, name: '未成年人监护情况' },
    zw: { bm: 9942, name: '职务' },
    zy_dm: { bm: 9947, name: '职业' }
  }
  const { BrowserWindow } = remote

  export default {
    name: 'CaseRegister',
    data () {
      return {
        casePath: '',
        sqlite: '',
        unitField: {
          id: 'DWBM',
          pid: 'FDWBM',
          label: 'DWMC'
        },
        dqField: {
          id: 'dm',
          pid: 'fdm',
          label: 'mc'
        },
        defaultSelection: [{ dm: 'Y', mc: '是' }, { dm: 'N', mc: '否' }],
        ajlbSelections: [{ dm: '0301', mc: '一审公诉案件' }],
        dossierType: {
          electronicDossier: 'electronicDossier', // 电子卷宗
          documentDossier: 'documentDossier', // 文书卷宗
          otherFile: 'otherFile'// 其他文件
        },

        stepObj: {
          1: '案件初始化',
          2: '案件基本信息',
          3: '嫌疑人信息',
          4: '证据材料'
        },
        currStep: 1,
        xyrxxDataIndex: 0,
        selectDossierType: 'electronicDossier',

        errors: {},

        djrxx_ZH: {
          unit: '单位',
          username: '用户名',
          userpsd: '密码',
          passwordAgain: '确认密码'
        },
        ajjbxxData_ZH: {
          bmsah: '部门受案号',
          tysah: '统一受案号',
          cbdw: '承办单位',
          slrq: '受理日期',
          ajmc: '案件名称',
          ajlb_bm: '案件类别',
          cbbm_mc: '承办部门',
          cbr: '承办人',
          zcjg_dwdm: '侦查机关',
          ysdw: '移送单位',
          yswswh: '移送文书文号',
          ysay_aydm: '移送案由',
          ysqtay_aydms: '移送其他案由',
          sfswaj: '涉外案件',
          sfdbaj: '督办案件',
          sfgzaj: '关注案件',
          aqzy: '案情摘要'
        },
        xyrxxData_ZH: {
          // bmsah: '部门受案号',
          xyrbh: '犯罪嫌疑人编号',
          xm: '姓名',
          sfzf: '是否主犯',
          cym: '曾用名',
          ch: '绰号',
          zjlx_dm: '证件类型',
          zjhm: '证件号码',
          xb_dm: '性别',
          mz_dm: '民族',
          csrq: '出生日期',
          zasnl: '作案时年龄',
          gj_dm: '国籍',
          csd: '出生地',
          hjszd: '户籍所在地',
          zsd: '住所地',
          zsdxxdz: '住所地详细地址',
          gzdw: '工作单位',
          gzdwszd: '工作单位所在地',
          zj_dm: '职级',
          zw: '职务',
          zy_dm: '职业',
          sf_dm: '身份',
          sjyzk_dm: '受教育状况',
          zzmm_dm: '政治面貌',
          rddb_dm: '人大代表',
          zxwy_dm: '政协委员',
          sfncjczzry: '农村基层组织人员',
          wcnrjhqk_dm: '未成年人监护情况',
          fddlr: '法定代理人',
          szxxmc: '所在学校名称'
        },

        isConvertPsd: false,
        djrxx: {
          unit: {},
          unitcode: '',
          unitname: '',
          username: '',
          userpsd: '',
          passwordAgain: ''
        },
        ajjbxxData: {
          bmsah: '',
          tysah: '',
          cbdw: {},
          cbdw_bm: '',
          cbdw_mc: '',
          slrq: '',
          ajmc: '',
          ajlb_bm: '',
          ajlb_mc: '',
          cbbm_bm: '',
          cbbm_mc: '',
          cbr: '',
          cbrgh: '',
          zcjg_dwdm: '',
          zcjg_dwmc: '',
          ysdw: {},
          ysdw_dwdm: '',
          ysdw_dwmc: '',
          yswswh: '',
          ysay_aydm: '',
          ysay_aymc: '',
          ysqtay_aydms: '',
          ysqtay_aymcs: '',
          sfswaj: '',
          sfdbaj: '',
          sfgzaj: '',
          aqzy: ''
        }, // 案件基本信息
        xyrxxData: [{
          bmsah: '',
          tysah: '',
          xyrbh: '',
          cbdw_bm: '',
          cbdw_mc: '',
          xm: '',
          sfzf: '',
          cym: '',
          ch: '',
          zjlx_dm: '',
          zjlx_mc: '',
          zjhm: '',
          xb_dm: '',
          xb_mc: '',
          mz_dm: '',
          mz_mc: '',
          csrq: '',
          zasnl: '',
          gj_dm: '',
          gj_mc: '',
          csd: {},
          csd_dm: '',
          csd_mc: '',
          hjszd: {},
          hjszd_dm: '',
          hjszd_mc: '',
          zsd: {},
          zsd_dm: '',
          zsd_mc: '',
          zsdxxdz: '',
          gzdw: '',
          gzdwszd: {},
          gzdwszd_dm: '',
          gzdwszd_mc: '',
          zj_dm: '',
          zj_mc: '',
          zw: '',
          zy_dm: '',
          zy_mc: '',
          sf_dm: '',
          sf_mc: '',
          sjyzk_dm: '',
          sjyzk_mc: '',
          zzmm_dm: '',
          zzmm_mc: '',
          rddb_dm: '',
          rddb_mc: '',
          zxwy_dm: '',
          zxwy_mc: '',
          sfncjczzry: '',
          wcnrjhqk_dm: '',
          wcnrjhqk_mc: '',
          fddlr: '',
          szxxmc: ''
        }], // 嫌疑人信息
        allZjclData: [], // 所有证据材料
        filterStr: '',

        currDeepth: {
          electronicDossier: 1, // 电子卷宗
          documentDossier: 1, // 文书卷宗
          otherFile: 1// 其他文件
        },
        currPid: {
          electronicDossier: null, // 电子卷宗
          documentDossier: null, // 文书卷宗
          otherFile: null// 其他文件
        }, // 当前级
        navData: {
          electronicDossier: [], // 电子卷宗
          documentDossier: [], // 文书卷宗
          otherFile: []// 其他文件
        },
        defaultId: uuid(),
        allLb: [],
        selections: [],
        convertStatus: false,
        tpl: {},
        preZjclShow: false
      }
    },
    computed: {
      ...mapState({
        loading: state => state.container.loading
      }),
      /**
       * 当前目录的文件夹和文件
       */
      currZjclData () {
        return this.allZjclData.filter(data => (!this.filterStr || data.name.indexOf(this.filterStr) > -1) && data.deepth === this.currDeepth[this.selectDossierType] && this.currPid[this.selectDossierType] === data.pid && this.selectDossierType === data.dossierType)
      },
      /**
       * 当前目录的文件数目
       */
      fileCount () {
        return this.currZjclData.filter(data => data.type !== 'dir').length
      },
      /**
       * 当前目录的文件夹数目
       */
      dirCount () {
        return this.currZjclData.filter(data => data.type === 'dir').length
      },
      zcjg_dwdm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.zcjg_dwdm.bm)
      },
      ay () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.ay.bm)
      },
      xb_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.xb_dm.bm)
      },
      zjlx_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.zjlx_dm.bm)
      },
      gj_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.gj_dm.bm)
      },
      mz_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.mz_dm.bm)
      },
      unitData () {
        return unitData
      },
      dq () {
        return dqData
      },
      zj_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.zj_dm.bm)
      },
      sjyzk_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.sjyzk_dm.bm)
      },
      sf_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.sf_dm.bm)
      },
      zzmm_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.zzmm_dm.bm)
      },
      rddb_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.rddb_dm.bm)
      },
      zxwy_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.zxwy_dm.bm)
      },
      wcnrjhqk_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.wcnrjhqk_dm.bm)
      },
      zw () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.zw.bm)
      },
      zy_dm () {
        return this.allLb.filter(_lb => _lb.lbbm === lb.zy_dm.bm)
      }
    },
    methods: {
      deleteSelected (ev) {
        if (this.isEdit) return
        for (let row of this.selections) {
          this.del(row, ev)
        }
      },
      rowClick (row, event, column) {
        if (!column.property || column.property === 'uploadStatus') return
        event.ctrlKey || this.$refs.zjclTable.clearSelection()
        this.$refs.zjclTable.toggleRowSelection(row)
      },
      cellStyle ({ row, column, rowIndex, columnIndex }) {
        return { padding: '5px 0' }
      },
      rowStyle ({ row, rowIndex }) {
        let isSelected = this.selections.find(_row => row.id === _row.id)
        if (isSelected) {
          return { background: '#cce8ff' }
        } else {
          return {}
        }
      },
      selectionChange (selection) {
        this.selections = selection
      },
      /**
       *  通过上传日期排序
       */
      sortByUpdate (data1, data2) {
        return new Date(data1.uploadDate).getTime() - new Date(data2.uploadDate).getTime()
      },
      sortByStatus (data1, data2) {
        return data1.uploadStatus - data2.uploadStatus
      },
      async done () {
        try {
          this.loadStatus({ loading: true, loadingText: '正在检查数据，请稍候...' })
          for (let zjcl of this.allZjclData) {
            if (zjcl.uploadStatus !== 1) {
              this.loadStatus({ loading: false })
              return this.$alert('请检查文件是否已全部上传成功', '提示', { type: 'warning' })
            }
          }
          this.loadStatus({ loading: true, loadingText: '正在保存，请稍候...' })
          // console.log(this.allZjclData);
          let sqls = []
          // let sqlStr = '';

          for (let _dossierType in this.dossierType) {
            let jzs = this.allZjclData.filter(zjcl => zjcl.dossierType === this.dossierType[_dossierType])
            let jzml = jzs.filter(zjcl => zjcl.type === 'dir')
            let jzmlwj = jzs.filter(zjcl => zjcl.type !== 'dir')
            let tpl = this.tpl[this.dossierType[_dossierType]]
            // 电子卷宗
            if (this.dossierType[_dossierType] === this.dossierType.electronicDossier) {
              if (jzml.length) {
                jzml.forEach((obj, index) => {
                  let dzjzmlObj = {
                    jzbh: null,
                    mlbh: null,
                    sfsc: 'N',
                    cjsj: moment().format('YYYY-MM-DD HH:mm:ss'),
                    zhxgsj: moment().format('YYYY-MM-DD HH:mm:ss'),
                    fqdwbm: null,
                    fql: null,
                    dwbm: this.ajjbxxData.cbdw_bm,
                    bmsah: this.ajjbxxData.bmsah,
                    fmlbh: null,
                    mlxx: null,
                    mlsxh: index,
                    mlbm: null,
                    mllx: null,
                    sfsm: null,
                    sslbbm: null,
                    sslbmc: null,
                    mlxsmc: obj.name,
                    sfzxdj: null,
                    nodeid: obj.id,
                    nodeparentid: obj.pid
                  }
                  sqls.push(get_insert_dzjzml_variable_sql(dzjzmlObj))
                  // sqlStr += get_insert_dzjzml_sql(dzjzmlObj) + '\n';
                })
              }
              if (jzmlwj.length) {
                jzmlwj.forEach((obj, index) => {
                  let dzjzmlwjObj = {
                    jzbh: null,
                    mlbh: null,
                    wjxh: obj.id,
                    sfsc: 'N',
                    cjsj: moment().format('YYYY-MM-DD HH:mm:ss'),
                    zhxgsj: moment().format('YYYY-MM-DD HH:mm:ss'),
                    fqdwbm: null,
                    fql: null,
                    dwbm: this.ajjbxxData.cbdw_bm,
                    bmsah: this.ajjbxxData.bmsah,
                    wjlj: null,
                    wjmc: obj.name,
                    wjxsmc: obj.name,
                    wjhz: obj.type,
                    wjksy: null,
                    wjjsy: null,
                    wjbzxx: null,
                    wjyzbz: null,
                    wjsxh: index,
                    wjzdy: null,
                    sslbbm: null,
                    sslbmc: null,
                    remark: null,
                    pdf: obj.src ? obj.src : path.parse(obj.filePath).base,
                    sfzxdj: null,
                    nodeid: obj.id,
                    nodeparentid: obj.pid
                  }
                  // sqlStr += get_insert_dzjzmlwj_sql(dzjzmlwjObj) + '\n';
                  sqls.push(get_insert_dzjzmlwj_variable_sql(dzjzmlwjObj))
                })
              }
              if (isNotEmpty(tpl)) {
                for (let id in tpl) {
                  for (let obj of tpl[id]) {
                    let dzjztplObj = { wjxh: id, id: uuid(), img: obj.Image, text: obj.Text, order: obj.Order }
                    // sqlStr += get_insert_dzjztpl_sql(dzjztplObj) + '\n';
                    sqls.push(get_insert_dzjztpl_variable_sql(dzjztplObj))
                  }
                }
              }
              // 文书卷宗
            } else if (this.dossierType[_dossierType] === this.dossierType.documentDossier) {
              if (jzml.length) {
                jzml.forEach((obj, index) => {
                  let wsjzmlObj = {
                    bmsah: this.ajjbxxData.bmsah,
                    tysah: this.ajjbxxData.tysah,
                    sfsc: 'N',
                    fqdwbm: null,
                    fql: null,
                    cjsj: null,
                    zhxgsj: null,
                    dwbm: this.ajjbxxData.cbdw_bm,
                    jzmlh: null,
                    jzmlmc: obj.name,
                    jzmlbm: obj.id,
                    jzfmlh: null,
                    jzmllx: null,
                    sflxsc: null,
                    scph: null,
                    sfzxdj: null,
                    nodeid: obj.id,
                    nodeparentid: obj.pid
                  }
                  // sqlStr += get_insert_wsjzml_sql(wsjzmlObj) + '\n';
                  sqls.push(get_insert_wsjzml_variable_sql(wsjzmlObj))
                })
              }
              if (jzmlwj.length) {
                jzmlwj.forEach((obj, index) => {
                  let wsjzmlwjObj = {
                    bmsah: this.ajjbxxData.bmsah,
                    tysah: this.ajjbxxData.tysah,
                    sfsc: 'N',
                    fqdwbm: null,
                    fql: null,
                    cjsj: null,
                    zhxgsj: null,
                    dwbm: this.ajjbxxData.cbdw_bm,
                    jzmlh: null,
                    jzwjh: null,
                    wsbh: obj.id,
                    xgrq: null,
                    wjmc: obj.name,
                    wjlx: null,
                    wscflj: null,
                    fwsbh: null,
                    nzrgh: null,
                    nzrxm: null,
                    wjkzm: obj.type,
                    rjsj: null,
                    rjrgh: null,
                    rjrxm: null,
                    wjsx: null,
                    gxywbms: null,
                    sfkygx: null,
                    wsmbbh: null,
                    yzbh: null,
                    yzmc: null,
                    yyzt: null,
                    dyzt: null,
                    yyhwjbh: null,
                    yjdyfs: null,
                    byzdyfs: null,
                    sfjh: null,
                    wh: null,
                    sflxsc: null,
                    scph: null,
                    remark: null,
                    pdf: obj.src ? obj.src : path.parse(obj.filePath).base,
                    sfzxdj: null,
                    nodeid: obj.id,
                    nodeparentid: obj.pid
                  }
                  // sqlStr += get_insert_wsjzmlwj_sql(wsjzmlwjObj) + '\n';
                  sqls.push(get_insert_wsjzmlwj_variable_sql(wsjzmlwjObj))
                })
              }
              if (isNotEmpty(tpl)) {
                for (let id in tpl) {
                  for (let obj of tpl[id]) {
                    let wsjztplObj = { wsbh: id, id: uuid(), img: obj.Image, text: obj.Text, order: obj.Order }
                    // sqlStr += get_insert_wsjztpl_sql(wsjztplObj) + '\n';
                    sqls.push(get_insert_wsjztpl_variable_sql(wsjztplObj))
                  }
                }
              }
            }
          }

          // let tempSqls = []

          // sqlStr += get_insert_user_sql(this.djrxx) + '\n';
          if (!this.isConvertPsd) {
            this.djrxx.userpsd = crypto
              .createHash('md5')
              .update(this.djrxx.userpsd)
              .digest('hex')
            this.isConvertPsd = true
          }
          sqls.push(get_insert_user_variable_sql(this.djrxx))
          this.ajjbxxData.sfzxdj = 'Y'
          // sqlStr += get_insert_ajjbxx_sql(this.ajjbxxData) + '\n';
          sqls.push(get_insert_ajjbxx_variable_sql(this.ajjbxxData))
          for (let xyrdata of this.xyrxxData) {
            // sqlStr += get_insert_xyrjbxx_sql(xyrdata) + '\n';
            sqls.push(get_insert_xyrjbxx_variable_sql(xyrdata))
          }

          // let result = await this.sqlite.exec(sqlStr);
          // let result = await UtilDLL.SqliteExecuteNonQueryByVariableBatch({
          //   path: this.casePath,
          //   password: '',
          //   sqls: sqls
          // });

          let result = await SQLite.ExecuteNonQuery({
            executeSql: sqls
          }, this.casePath)
          console.log(result)
          if (result) {
            await this.$alert('保存成功，点击确定打开案件', '提示', { type: 'warning' })
            this.openCase(this.casePath)
          } else {
            this.$alert('保存失败', '错误', { type: 'error' })
          }
        } catch (e) {
          console.error(e)
        } finally {
          this.loadStatus({ loading: false })
        }
      },
      async gotoStep (step) {
        console.log(this.currStep, step)
        if (this.currStep >= step) return
        if (this.currStep === 1) {
          console.log('当前为第一步')
          if (await this.check(this.djrxx_ZH)) return
          this.djrxx.unitcode = this.djrxx.unit.DWBM
          this.djrxx.unitname = this.djrxx.unit.DWMC
        } else if (this.currStep === 2) {
          console.log('当前为第二步')
          if (await this.check(this.ajjbxxData_ZH)) return
          if (isNotEmpty(this.ajjbxxData.cbdw)) {
            this.ajjbxxData.cbdw_bm = this.ajjbxxData.cbdw.DWBM
            this.ajjbxxData.cbdw_mc = this.ajjbxxData.cbdw.DWMC
          }
          if (isNotEmpty(this.ajjbxxData.ysdw)) {
            this.ajjbxxData.ysdw_dwdm = this.ajjbxxData.ysdw.DWBM
            this.ajjbxxData.ysdw_dwmc = this.ajjbxxData.ysdw.DWMC
          }
          if (isNotEmpty(this.ajjbxxData.ajlb_bm)) {
            this.ajjbxxData.ajlb_mc = this.ajlbSelections.find(_item => _item.dm === (this.ajjbxxData.ajlb_bm)).mc
          } else {
            this.ajjbxxData.ajlb_bm = '0301'
            this.ajjbxxData.ajlb_mc = '一审公诉案件'
          }
          if (isNotEmpty(this.ajjbxxData.zcjg_dwdm)) {
            this.ajjbxxData.zcjg_dwmc = this.zcjg_dwdm.find(_item => _item.dm === (this.ajjbxxData.zcjg_dwdm)).mc
          }
          if (isNotEmpty(this.ajjbxxData.ysay_aydm)) {
            this.ajjbxxData.ysay_aymc = this.ay.find(_item => _item.dm === (this.ajjbxxData.ysay_aydm)).mc
          }
          if (isNotEmpty(this.ajjbxxData.ysqtay_aydms)) {
            this.ajjbxxData.ysqtay_aymcs = this.ay.find(_item => _item.dm === (this.ajjbxxData.ysqtay_aydms)).mc
          }
          if (!isNotEmpty(this.ajjbxxData.sfswaj)) this.ajjbxxData.sfswaj = 'N'
          if (!isNotEmpty(this.ajjbxxData.sfdbaj)) this.ajjbxxData.sfdbaj = 'N'
          if (!isNotEmpty(this.ajjbxxData.sfgzaj)) this.ajjbxxData.sfgzaj = 'N'
        } else if (this.currStep === 3) {
          console.log('当前为第三步')
          if (await this.check(this.xyrxxData_ZH)) return

          this.xyrxxData.forEach(item => {
            item.bmsah = this.ajjbxxData.bmsah
            item.tysah = this.ajjbxxData.tysah
            item.cbdw_bm = this.ajjbxxData.cbdw_bm
            item.cbdw_mc = this.ajjbxxData.cbdw_mc

            item.xyrbh = uuid()

            if (isNotEmpty(item.csd)) {
              item.csd_dm = item.csd.dm
              item.csd_mc = item.csd.mc
            }
            if (isNotEmpty(item.hjszd)) {
              item.hjszd_dm = item.hjszd.dm
              item.hjszd_mc = item.hjszd.mc
            }
            if (isNotEmpty(item.zsd)) {
              item.zsd_dm = item.zsd.dm
              item.zsd_mc = item.zsd.mc
            }
            if (isNotEmpty(item.gzdwszd)) {
              item.gzdwszd_dm = item.gzdwszd.dm
              item.gzdwszd_mc = item.gzdwszd.mc
            }
            if (isNotEmpty(item.zjlx_dm)) {
              item.zjlx_mc = this.zjlx_dm.find(_item => _item.dm === (item.zjlx_dm)).mc
            }
            if (isNotEmpty(item.xb_dm)) {
              item.xb_mc = this.xb_dm.find(_item => _item.dm === (item.xb_dm)).mc
            } else {
              item.xb_dm = '9909180000001'
              item.xb_mc = '男性'
            }
            if (isNotEmpty(item.mz_dm)) {
              item.mz_mc = this.mz_dm.find(_item => _item.dm === (item.mz_dm)).mc
            } else {
              item.mz_dm = '9912180100001'
              item.mz_mc = '汉族'
            }
            if (isNotEmpty(item.gj_dm)) {
              item.gj_mc = this.gj_dm.find(_item => _item.dm === (item.gj_dm)).mc
            } else {
              item.gj_dm = '9911180200001'
              item.gj_mc = '中国'
            }
            if (isNotEmpty(item.zj_dm)) {
              item.zj_mc = this.zj_dm.find(_item => _item.dm === (item.zj_dm)).mc
            }
            if (isNotEmpty(item.zy_dm)) {
              item.zy_mc = this.zy_dm.find(_item => _item.dm === (item.zy_dm)).mc
            }
            if (isNotEmpty(item.sf_dm)) {
              item.sf_mc = this.sf_dm.find(_item => _item.dm === (item.sf_dm)).mc
            }
            if (isNotEmpty(item.sjyzk_dm)) {
              item.sjyzk_mc = this.sjyzk_dm.find(_item => _item.dm === (item.sjyzk_dm)).mc
            }
            if (isNotEmpty(item.zzmm_dm)) {
              item.zzmm_mc = this.zzmm_dm.find(_item => _item.dm === (item.zzmm_dm)).mc
            } else {
              item.zzmm_dm = '9917180500001'
              item.zzmm_mc = '群众'
            }
            if (isNotEmpty(item.rddb_dm)) {
              item.rddb_mc = this.rddb_dm.find(_item => _item.dm === (item.rddb_dm)).mc
            } else {
              item.rddb_dm = '9918181500001'
              item.rddb_mc = '无'
            }
            if (isNotEmpty(item.zxwy_dm)) {
              item.zxwy_mc = this.zxwy_dm.find(_item => _item.dm === (item.zxwy_dm)).mc
            } else {
              item.zxwy_dm = '9919181400001'
              item.zxwy_mc = '无'
            }
            if (isNotEmpty(item.wcnrjhqk_dm)) {
              item.wcnrjhqk_mc = this.wcnrjhqk_dm.find(_item => _item.dm === (item.wcnrjhqk_dm)).mc
            }
            if (!isNotEmpty(item.sfncjczzry)) item.sfncjczzry = 'N'
          })

          // 第一次保存
          // 需要先选保存路径
          if (!this.casePath) {
            let win = BrowserWindow.getFocusedWindow()
            let res = remote.dialog.showSaveDialog(win, {
              title: '案件登记保存',
              defaultPath: this.ajjbxxData.ajmc,
              filters: [{
                name: 'Case',
                extensions: ['case']
              }]
            })
            if (!res) return
            let templatePath = path.resolve(execDir + '/Config/template.case')
            await copyFileSync(templatePath, res)
            this.casePath = res
          }

          let index = this.allZjclData.findIndex(data => data.id === this.defaultId)
          if (index === -1) {
            this.allZjclData.push({
              pid: null,
              id: this.defaultId,
              deepth: 0,
              uploadDate: moment().format('YYYY-MM-DD HH:mm:ss'),
              name: this.ajjbxxData.ajmc,
              fileSize: '',
              type: 'dir',
              dossierType: '',
              uploadStatus: 1
            })
            for (let pid in this.currPid) {
              this.currPid[pid] = this.defaultId
            }
          } else {
            this.allZjclData[index].name = this.ajjbxxData.ajmc
          }
        }
        if (this.currStep < step && this.currStep + 1 !== step) {
          console.log(step, '翻页')
          this.currStep++
          await this.gotoStep(step)
          return
        }
        console.log('翻页结束')
        this.currStep = step// 翻页
      },
      checkValue (item) {
        let errmsg = ''
        let ZH = {}
        if (item in this.djrxx_ZH) {
          ZH = this.djrxx_ZH
        } else if (item in this.ajjbxxData_ZH) {
          ZH = this.ajjbxxData_ZH
        } else if (item in this.xyrxxData_ZH) ZH = this.xyrxxData_ZH
        // console.log(`case '${item}':
        // if (!this.ajjbxxData[item]) errmsg = '不能为空';
        // break;`)
        switch (item) {
          // case 'xyrbh':
          //   if (!this.xyrxxData[this.xyrxxDataIndex][item]) errmsg = `【${ZH[item]}】不能为空`;
          //   break;
          case 'xm':
            if (!this.xyrxxData[this.xyrxxDataIndex][item]) errmsg = `【${ZH[item]}】不能为空`
            break
          case 'sfzf':
            if (!this.xyrxxData[this.xyrxxDataIndex][item]) errmsg = `【${ZH[item]}】不能为空`
            break
          case 'unit':
            if (!isNotEmpty(this.djrxx[item])) errmsg = '请选择单位'
            break
          case 'username':
            if (!this.djrxx[item].trim().length) errmsg = `【${ZH[item]}】不能为空`
            break
          case 'userpsd':
            if (!this.djrxx[item].trim().length) errmsg = `【${ZH[item]}】不能为空`
            if (isNotEmpty(this.djrxx['passwordAgain']) && this.djrxx[item] !== this.djrxx['passwordAgain']) {
              this.$set(this.errors, 'passwordAgain', '两次密码不相同')
            } else {
              delete this.errors['passwordAgain']
            }
            break
          case 'passwordAgain':
            if (this.djrxx['userpsd'] !== this.djrxx[item]) errmsg = '两次密码不相同'
            break
          case 'bmsah':
            if (!this.ajjbxxData[item]) errmsg = `【${ZH[item]}】不能为空`
            break
          case 'tysah':
            if (!this.ajjbxxData[item]) errmsg = `【${ZH[item]}】不能为空`
            break
          case 'cbdw':
            if (!isNotEmpty(this.ajjbxxData[item])) errmsg = `请选择【${ZH[item]}】`
            break
          case 'slrq':
            if (!this.ajjbxxData[item]) errmsg = `【${ZH[item]}】不能为空`
            break
          case 'ajmc':
            if (!this.ajjbxxData[item]) errmsg = `【${ZH[item]}】不能为空`
            break
          case 'ajlb_bm':
            if (!this.ajjbxxData[item]) errmsg = `【${ZH[item]}】不能为空`
            break
        }
        this.$set(this.errors, item, errmsg)
        return !!errmsg
      },
      switchType (type) {
        this.selectDossierType = type
      },
      search (ev) {
        this.filterStr = ev.target.value
      },
      rename (row, ev) {
        if (row.uploadStatus !== 1) return this.$alert('文件没有上传成功，不允许修改名字', '提示', { type: 'warning' })
        let el = document.getElementById(row.id)
        el.setAttribute('contenteditable', true)
        el.focus()
        window.getSelection().selectAllChildren(el)
        this.isEdit = true
      },
      saveName (row, ev) {
        let el = document.getElementById(row.id)
        el.setAttribute('contenteditable', false)
        this.isEdit = false
        let nameRE = new RegExp('^' + el.innerText + '$')
        let files = this.currZjclData.filter(data => data.id !== row.id && nameRE.test(data.name) && data.type === row.type)
        if (files.length) {
          el.innerText = row.name
          this.$alert('名称已存在', '提示', { type: 'warning' })
          return
        }

        if (!el.innerText.length) el.innerText = row.name
        let RE = new RegExp(row.type + '$')
        if (row.type !== 'dir' && !RE.test(el.innerText)) el.innerText += row.type
        row.name = el.innerText
        if (!row.filePath) return
        const { dir } = path.parse(row.filePath)
        let newPath = path.resolve(dir, el.innerText)
        let oldPath = row.filePath
        fs.renameSync(oldPath, newPath)
        row.filePath = newPath
      },
      gotoLevel (pid, deepth) {
        this.currPid[this.selectDossierType] = pid
        this.currDeepth[this.selectDossierType] = deepth
        for (let index = 0; index < this.navData[this.selectDossierType].length; index++) {
          if (this.navData[this.selectDossierType][index].deepth > deepth) {
            this.navData[this.selectDossierType].splice(index, 1)
            index--
          }
        }
      },
      /**
       * 返回上一级
       */
      prevLevel () {
        if (this.currDeepth[this.selectDossierType] === 1) return
        // 寻找到上级内容的pid
        // 该级内容的id
        let row = this.allZjclData.find(data => {
          return data.id === this.currPid[this.selectDossierType]
        })
        this.gotoLevel(row.pid, this.currDeepth[this.selectDossierType] - 1)
      },
      repeatName (name, type) {
        let nameRE = new RegExp(name + '(\\s\\((\\d+)\\))?')
        let files = []
        if (/mp3|mp4/i.test(type)) {
          files = this.allZjclData.filter(data => nameRE.test(data.name) && data.type === type)
        } else {
          files = this.currZjclData.filter(data => nameRE.test(data.name) && data.type === type)
        }
        let nums = []
        for (let item of files) {
          let resArr = item.name.match(nameRE)
          if (!resArr[2]) {
            nums.push(1)
            continue
          }
          let _num = parseInt(resArr[2])
          nums.findIndex(__num => __num === _num) > -1 || nums.push(_num)
        }
        let nextNum = 0
        nums.sort((a, b) => a - b)
        for (let i = 0; i < nums.length; i++) {
          if (i === nums.length - 1) {
            nextNum = nums[i] + 1
            break
          }
          if (nums[i] !== nums[i + 1] - 1) {
            nextNum = nums[i] + 1
            break
          }
        }
        return nextNum ? `${name} (${nextNum})` : name
      },
      /**
       * 新建文件夹
       */
      newDir () {
        let name = this.repeatName('新建文件夹', 'dir')
        let row = {
          pid: this.currPid[this.selectDossierType],
          id: uuid(),
          deepth: this.currDeepth[this.selectDossierType],
          uploadDate: moment().format('YYYY-MM-DD HH:mm:ss'),
          name: name,
          fileSize: '',
          type: 'dir',
          dossierType: this.selectDossierType,
          uploadStatus: 1
        }
        this.allZjclData.push(row)
        this.$nextTick(() => {
          this.rename(row)
        })
      },
      /**
       * 上传文件
       */
      async upload () {
        let filters = [
          {
            name: '文档',
            extensions: ['doc', 'docx', 'pdf']
          },
          {
            name: '图片',
            extensions: ['png', 'jpg', 'bmp']
          },
          {
            name: '音频',
            extensions: ['mp3']
          },
          {
            name: '视频',
            extensions: ['mp4']
          }
        ]
        let allType = {
          name: '所有支持格式',
          extensions: []
        }
        for (let item of filters) {
          allType.extensions = [...allType.extensions, ...item.extensions]
        }
        filters.splice(0, 0, allType)
        let win = BrowserWindow.getFocusedWindow()
        let res = remote.dialog.showOpenDialog(win, {
          properties: ['openFile', 'showHiddenFiles', 'multiSelections'],
          filters
        })
        if (!res) return
        // -------------------------------选择文件之后-------------------------------------------------------
        let isOverSize = false

        // -------------------------------开始遍历每一个文件--------------------------------------------------
        for (let filePath of res) {
          // 获取文件的大小（单位：B）
          let size = fs.statSync(filePath).size
          let { ext, name } = path.parse(filePath)

          // 文件的打开方式
          let openType = ''
          for (let type in extStrRE) {
            if (extStrRE[type].test(ext)) openType = type
          }

          // 判断文件大小是否超过100MB
          if (!/video|audio/.test(openType) && size > 100 * 1024 * 1024) {
            if (!isOverSize) { // 表示未提醒，则提醒用户一次
              isOverSize = true// 标记为已提醒
              await this.$alert(`大小超过100MB的文件将取消上传`, '提示', { type: 'warning' })
            }
            continue
          }

          // 未提醒word，则提示用户word
          // if (/docx?/.test(ext) && !isWord) {
          //   isWord = true;
          //   await this.$confirm(`word文档将会被转换为pdf进行上传，转换不会影响您原本的文件, 是否继续?`, '提示');
          // }

          // 获取文件的显示名称
          let _name = this.repeatName(name, ext)

          // 获取文件的显示大小（带单位）
          let units = ['B', 'KB', 'MB', 'GB', 'TB']
          let unitIndex = 0
          while (size > 1024) {
            size = Math.round(parseFloat(size / 1024) * 10) / 10
            unitIndex++
          }

          // 组装文件对象
          let dataObj = {
            pid: this.currPid[this.selectDossierType],
            id: uuid(),
            deepth: this.currDeepth[this.selectDossierType],
            uploadDate: moment().format('YYYY-MM-DD HH:mm:ss'),
            name: _name + ext, // 文件显示名称
            fileSize: size + units[unitIndex], // 文件大小
            type: ext, // 后缀
            openType, // 打开方式
            filePath, // 文件路径
            src: '', // 文件资源
            dossierType: this.selectDossierType, // 卷宗类型
            uploadStatus: 0/* /video|audio|word|pdf/.test(openType) ? 0 : 1 */
          }

          this.allZjclData.push(dataObj)
          dataObj.uploadStatus || uploadList.push(dataObj)
        }
        uploadList.length && await this.uploadStart(uploadList[0])
      },
      async uploadStart (convertObj) {
        if (this.convertStatus) {
          let isExixt = uploadList.findIndex(item => item.id === convertObj.id) > -1
          isExixt || uploadList.push(convertObj)
          return
        }
        this.convertStatus = true
        // 获取到要修改的文件
        let zjclData = this.allZjclData.find(item => item.id === convertObj.id)
        if (!zjclData) {
          try {
            return uploadList.length && await this.uploadStart(uploadList[0])
          } catch (e) {
            throw e
          }
        }
        let { id, filePath, openType } = zjclData
        try {
          let { ext, name } = path.parse(filePath)

          let isSucc = false
          let newFilePath = zjclData.filePath
          if (/word/.test(zjclData.openType)) { // word转pdf
            let result = await SQLite.DocumentConvertToImage([zjclData.filePath], this.casePath, false)
            // let result = await UtilDLL.Word2Image({filePath: zjclData.filePath});
            // let result = await this.$store.dispatch(A.COMMON.ConvertFile, zjclData.filePath);
            // result = JSON.parse(result);

            if (!this.tpl[zjclData.dossierType]) this.tpl[zjclData.dossierType] = {}
            this.tpl[zjclData.dossierType][zjclData.id] = result[0].Files
            zjclData.src = result[0].PDF
            zjclData.filePath = ''
            zjclData.openType = 'pdf'
            isSucc = true
          } else if (/audio|video/.test(openType)) {
            // let _name = this.repeatName(name, ext);
            newFilePath = `${this.casePath.replace(path.parse(this.casePath).ext, '')}/${name}${ext}`
            try {
              await new Promise((resolve, reject) => {
                let ev = copyFile(zjclData.filePath, newFilePath)
                ev.on('end', resolve)
                // ev.on('process', console.log);
              })
              zjclData.filePath = newFilePath
              if (!this.tpl[zjclData.dossierType]) this.tpl[zjclData.dossierType] = {}
              this.tpl[zjclData.dossierType][zjclData.id] = [{
                Image: path.parse(newFilePath).base,
                Order: 1,
                Text: ''
              }]
              isSucc = true
            } catch (e) {
              console.error(e)
            }
          } else if (/pdf/.test(openType)) {
            try {
              // let result = await this.$store.dispatch(A.COMMON.ConvertFile, zjclData.filePath);
              // result = JSON.parse(result);
              let result = await SQLite.DocumentConvertToImage([zjclData.filePath], this.casePath, false)

              // let result = await UtilDLL.Pdf2Image({filePath: zjclData.filePath});

              if (!this.tpl[zjclData.dossierType]) this.tpl[zjclData.dossierType] = {}
              this.tpl[zjclData.dossierType][zjclData.id] = result[0].Files
              zjclData.src = result[0].PDF
              zjclData.filePath = ''
              isSucc = true
            } catch (e) {
              console.error(e)
            }
          } else if (/image/.test(openType)) {
            let base64 = `data:image/${zjclData.type.replace(/\./g, '')};base64,` + fs.readFileSync(zjclData.filePath).toString('base64')
            zjclData.src = base64
            zjclData.filePath = ''
            if (!this.tpl[zjclData.dossierType]) this.tpl[zjclData.dossierType] = {}
            this.tpl[zjclData.dossierType][zjclData.id] = [{
              Image: base64,
              Order: 1,
              Text: ''
            }]
            isSucc = true
          }
          if (isSucc) {
            zjclData.uploadStatus = 1
          } else {
            zjclData.uploadStatus = 2
          }
        } catch (e) {
          console.error(e)
          zjclData.uploadStatus = 2
        }
        let convertObjIndex = uploadList.findIndex(item => item.id === id)
        if (convertObjIndex > -1) uploadList.splice(convertObjIndex, 1)

        this.convertStatus = false
        uploadList.length && await this.uploadStart(uploadList[0])
      },
      /**
       * 上传重试
       */
      uploadRetry (row, ev) {
        // console.log('重试', row);
        row.uploadStatus = 0
        this.uploadStart(row)
      },

      getUploadStatus (row, obj = { status: 1, failCount: 0, runCount: 0 }) {
        if (typeof obj !== 'object') return console.error('参数不正确，请检查')
        for (let zjcl of this.allZjclData) {
          if (zjcl.pid !== row.id) continue// 不是当前row的子元素
          if (zjcl.uploadStatus === 0) { // 上传中
            obj.status = 0
            obj.runCount++
          }
          if (zjcl.uploadStatus === 2) {
            // 上传失败
            obj.status = obj.status !== 0 ? 2 : 0// 如果状态未被标记为上传中，则修改为失败
            obj.failCount++
          }
          this.getUploadStatus(zjcl, obj)
        }
        return obj.status
      },
      /**
       * 行鼠标右键
       */
      contextmenu (row, ev) {
        let isTrue = this.selections.find(_row => row.id === _row.id)
        isTrue || this.$refs.zjclTable.clearSelection()
        this.$refs.zjclTable.toggleRowSelection(row, true)

        function getBase64 (url) {
          return (
            'data:image/png;base64,' +
            fs.readFileSync(staticPath + url).toString('base64')
          )
        }

        let contextmenu = [
          {
            label: row.type === 'dir' ? '打开' : '预览',
            icon: getBase64('/img/catalog/yl.png'),
            show: this.selections.length === 1,
            click: e => {
              this.open(this.selections[0], e)
            }
          }, {
            label: '删除',
            icon: getBase64('/img/catalog/04.png'),
            show: true,
            click: this.deleteSelected
          }, {
            label: '重命名',
            icon: getBase64('/img/catalog/cmm.png'),
            show: this.selections.length === 1,
            click: e => {
              this.rename(this.selections[0], e)
            }
          }, {
            label: '新建文件夹',
            icon: getBase64('/img/catalog/02.png'),
            show: true,
            click: this.newDir
          }]

        this.contextMenuShow(ev, contextmenu)
      },

      /**
       * 删除
       */
      del (row, event) {
        let index = this.allZjclData.findIndex(item => item.id === row.id)
        if (index > -1) this.allZjclData.splice(index, 1)
        if (this.tpl[this.selectDossierType]) delete this.tpl[this.selectDossierType][row.id]
      },

      /**
       * 表格行双击事件，打开文件或者文件夹
       * @param row
       * @param event
       */
      async open (row, event, column) {
        // console.log(row)
        if (column) if (!column.property || column.property === 'uploadStatus') return
        if (row.type === 'dir') {
          this.currDeepth[this.selectDossierType] = row.deepth + 1
          this.currPid[this.selectDossierType] = row.id
          this.navData[this.selectDossierType].push({ pid: row.id, deepth: row.deepth + 1, name: row.name })
        } else {
          if (row.uploadStatus === 0) return this.$alert('文件正在上传，请稍候再试', '提示', { type: 'warning' })
          if (row.openType === 'word') {
            try {
              openDirOrFile(row.filePath)
            } catch (e) {
              this.$alert('失败原因：' + e.message, '打开失败', { type: 'error' })
              console.error(e)
            }
          } else if (/audio|video/.test(row.openType)) {
            this.preZjclShow = true
            this.$nextTick(() => {
              this.$refs.preZjcl.show(row.filePath)
            })
          } else if (row.openType === 'image') {
            this.preZjclShow = true
            this.$nextTick(() => {
              let src = row.filePath ? row.filePath : row.src
              this.$refs.preZjcl.show(src)
            })
          } else if (row.openType === 'pdf') {
            this.preZjclShow = true
            this.$nextTick(() => {
              let src = row.filePath ? row.filePath : row.src
              this.$refs.preZjcl.show(src)
            })
          }
        }
      },
      async changeXyrPage (index) {
        if (await this.check(this.xyrxxData_ZH)) return
        this.xyrxxDataIndex = index
      },
      async addXyr () {
        if (await this.check(this.xyrxxData_ZH)) return
        this.xyrxxData.push({
          sfzf: '',
          xb_dm: '',
          mz_dm: '',
          gj_dm: '',
          csd: {},
          hjszd: {},
          zsd: {},
          gzdwszd: {},
          zzmm_dm: '',
          zzmm_mc: '',
          rddb_dm: '',
          zxwy_dm: '',
          sfncjczzry: ''
        })
        this.xyrxxDataIndex = this.xyrxxData.length - 1
      },
      delXyr () {
        if (this.xyrxxData.length === 1) return this.$alert('当前仅有1页嫌疑人，不允许删除', '提示', { type: 'warning' })
        this.errors = {}
        this.xyrxxData.splice(this.xyrxxDataIndex, 1)
        if (this.xyrxxDataIndex > this.xyrxxData.length - 1) this.xyrxxDataIndex = this.xyrxxData.length - 1
      },
      async check (obj) {
        let isError = false
        for (let name in obj) {
          if (this.checkValue(name)) {
            if (!isError) {
              let el = document.getElementById(name)
              if (el) {
                el.scrollIntoView()
                el.focus()
              }
            }
            isError = true
          }
        }
        if (isError) await this.$alert('请修正所有错误项后再次操作', '提示', { type: 'warning' })

        // return false;
        return isError
      }
    },
    async created () {
      try {
        this.loadStatus({ loading: true, loadingText: '数据准备中，请稍候...' })
        let configDbPath = path.resolve(execDir + './Config/config.db')

        this.allLb = await SQLite.ExecuteReader({
          SQL: 'select * from xt_dm_fldm order by dm asc',
          Parameter: {}
        }, configDbPath, '')

        if (!unitData.length) {
          unitData = getTreeDataSource(UNIT_DATA, 'DWBM', 'FDWBM', '')
        }
        if (!dqData.length) {
          let data = await SQLite.ExecuteReader({
            SQL: 'select * from xt_dm_fldm where lbbm=\'9913\' order by dm asc',
            Parameter: {}
          }, configDbPath, '')
          dqData = getTreeDataSource(data, 'dm', 'fdm', '')
        }
      } catch (e) {
        console.log(e)
      } finally {
        this.loadStatus({ loading: false })
      }
    }
  }
</script>

<style scoped>
.case_register_main_box * {
  box-sizing: border-box;
  font-size: 0;
  cursor: default;
  float: none !important;
}

.case_register_main_box {
  width: 100%;
  position: relative;
}

.error {
  display: inline-block;
  height: 28px;
  width: 28px;
  background-image: url("~@/assets/img/w.png");
  background-repeat: no-repeat;
  background-position: center;
}

input[type='date']::-webkit-clear-button,
input[type='date']::-webkit-inner-spin-button {
  display: none;
}

.case_register_main {
  height: 100%;
  position: relative;
  min-width: 830px !important;
}

.btn,
.label,
.input,
.textarea {
  font-size: 13px;
  /*padding-left: 3px;*/
}

.required {
  color: red;
  font-size: 16px;
  /*position: absolute;*/
  /*left: -7px;*/
  /*top: 13px;*/
  /*display: none;*/
}

.row_col {
  position: relative;
}

.step1, .step2, .step3, .step4 {
  outline: none;
  height: calc(100% - 70px);
}

.box .label {
  color: #666;
}

.box .input,
.box .textarea {
  color: #333;
  cursor: auto;
}

.step1 .box {
  margin: 0 auto 0;
  padding-top: 65px;
  text-align: center;
}

.item {
  position: relative;
  margin: 5px 0;
  display: inline-block;
}

.step1 .label {
  vertical-align: top;
  height: 28px;
  width: 85px;
  display: inline-block;
  line-height: 28px;
  text-align: right;
  margin-right: 10px;
  margin-left: 10px;
}

.step1 .select {
  height: 28px;
  border: 1px #dcdfe6 solid;
  display: inline-block;
  text-align: left;
  width: 240px;
  cursor: pointer;
  font-size: 13px;
  border-radius: 3px;
  margin: 0 !important;
}

.step1 .input {
  /*border: 1px #c2d3dd solid;*/
  /*height: 34px;*/
  width: 240px;
  /*text-align: left;*/
  /*font-size: 14px;*/
}

.btn {
  background: #409EFF;
  width: 80px;
  height: 30px;
  border: none;
  outline: none;
  border-radius: 3px;
  color: white;
  margin-left: 10px;
  font-size: 13px;
}

.btn:hover {
  background: #66b1ff;
}

.btn_box {
  position: absolute;
  bottom: 10px;
  right: 70px;
}

.step1 .btn_box {
  text-align: right;
  position: static;
  margin-top: 50px;
  padding-right: 25px;
}

.step2 {
  overflow: auto;
  height: 100%;
  width: 100%;
}

.left,
.right {
  position: relative;
  width: 50%;
  display: inline-block;
}

.right {
  text-align: right;
}

.step3 .box {
  height: 100%;
}

.step2 .label,
.step3 .label {
  vertical-align: top;
  height: 28px;
  width: 115px;
  display: inline-block;
  line-height: 28px;
  text-align: right;
  margin-right: 10px;
  margin-left: 10px;
}

.step3 .label {
  width: 147px;
}

.step2 .input,
.step3 .input {
  /*border: 1px #c2d3dd solid;*/
  /*height: 34px;*/
  width: 216px;
  /*text-align: left;*/
  font-size: 13px;
  height: 28px;
  border-radius: 3px;
}

.step3 .select,
.step2 .select {
  border: 1px #dcdfe6 solid;
  height: 28px;
  width: 216px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  display: inline-block;
  margin: 0 !important;

  border-radius: 3px;
}

.step2 .box {
  height: 100%;
}

.textarea {
  /*border: 1px #c2d3dd solid;*/
  /*height: 120px;*/
  width: calc(100% - 163px);
}

.input,
.textarea {
  /*cursor: auto;*/
}

.select:focus
  /*.input:focus,*/
  /*.textarea:focus*/
{
  outline: 1px solid #409eff;
}

.step3 .first,
.step3 .prev,
.step3 .next,
.step3 .last {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  cursor: pointer;
}

.step3 .first {
  background: url("~@/assets/img/ajdj/arrow-l-.png") no-repeat;
  margin-right: 10px;
}

.step3 .first:hover {
  background: url("~@/assets/img/ajdj/arrow-l--.png") no-repeat;
}

.step3 .prev {
  background: url("~@/assets/img/ajdj/arrow-l1.png") no-repeat;
  margin-right: 20px;
}

.step3 .prev:hover {
  background: url("~@/assets/img/ajdj/arrow-l.png") no-repeat;
}

.step3 .next {
  background: url("~@/assets/img/ajdj/arrow-r.png") no-repeat;
  margin-left: 20px;
  margin-right: 10px;
}

.step3 .next:hover {
  background: url("~@/assets/img/ajdj/arrow-r1.png") no-repeat;
}

.step3 .last {
  background: url("~@/assets/img/ajdj/arrow-r-.png") no-repeat;
}

.step3 .last:hover {
  background: url("~@/assets/img/ajdj/arrow-r--.png") no-repeat;
}

.step3 .add,
.step3 .del {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  font-size: 14px;
  vertical-align: top;
  margin-left: 5px;
  background-repeat: no-repeat;
  background-position: center center;
  cursor: pointer;
}

.step3 .add {
  background-image: url("~@/assets/img/ajdj/xyrjia.png");
}

.step3 .del {
  background-image: url("~@/assets/img/ajdj/xyrdel.png");
}

.step4,
.step4 .box {
  height: 100%;
}

.step4 .bar {
  border-bottom: 1px solid #d1d9dd;
  height: 35px;
}

.step4 .bar div {
  height: 36px;
  font-size: 16px;
  line-height: 36px;
  display: inline-block;
  margin-right: 20px;
  padding-left: 10px;
  padding-right: 10px;
  color: #666;
}

.step4 .bar .selected {
  border-bottom: 3px solid #467ea7;
  color: #333;
}

.step4 .title {
  margin-top: 10px;
  position: relative;
}

.title .img {
  height: 14px;
  width: 14px;
  display: inline-block;
}

.title button {
  background: transparent;
  border: #9fbbd1 1px solid;
  width: 90px;
  height: 30px;
  outline: none;
  border-radius: 3px;
  margin-right: 10px;
}

.title button .label {
  color: #5bb3ee;
  font-size: 14px;
  vertical-align: middle;
}

.title button .img {
  vertical-align: middle;
  margin-right: 5px;
}

.title button:hover {
  background: #319ee9;
}

.title button:hover .label {
  color: white;
}

.title .newdir {
  width: 130px;
}

.upload .img {
  background: url("~@/assets/img/ajdj/up-.png") no-repeat;
}

.newdir .img {
  background: url("~@/assets/img/ajdj/jia.png") no-repeat;
}

.rename .img {
  background: url("~@/assets/img/ajdj/cmm.png") no-repeat;
}

.del .img {
  background: url("~@/assets/img/ajdj/del.png") no-repeat;
}

.upload:hover .img {
  background: url("~@/assets/img/ajdj/up.png") no-repeat;
}

.newdir:hover .img {
  background: url("~@/assets/img/ajdj/jia-.png") no-repeat;
}

.rename:hover .img {
  background: url("~@/assets/img/ajdj/cmm-.png") no-repeat;
}

.del:hover .img {
  background: url("~@/assets/img/ajdj/del-.png") no-repeat;
}

.title .search {
  display: inline-block;
  /*vertical-align: middle;*/
  position: absolute;
  right: 0;
  top: 50%;
  transform: translate(0, -50%);
}

.search .input {
  height: 40px;
  border: 1px #c2d3dd solid;
  border-radius: 20px;
  padding-left: 20px;
  padding-right: 30px;
  outline: none;
  cursor: auto;
}

.search .input:focus {
  box-shadow: 0 0 0 1px #00ccff;
}

.search img {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translate(0, -50%);
}

.step4 .box .nav {
  margin: 5px 0;
}

.step4 .box .nav > span {
  font-size: 14px;
  color: #319ee9;
  cursor: pointer;
}

.step4 .fileContent {
  height: calc(100% - 150px);
  outline: none;
}

.step4 .fileContent * {
  font-size: 14px;
}

.step_bar {
  position: absolute;
  top: -50px;
  left: 200px;
  min-width: 540px;
  width: calc(100% - 200px);
  /*overflow-x: hidden;*/
}

.step_bar_item {
  display: inline-block;
  background: #a1bcd2;
  height: 32px;
  width: calc(25% + 20px);
  border-radius: 16px;
  margin-left: -20px;
  position: relative;
  cursor: default;
}

.step_bar_label {
  height: 100%;
  line-height: 32px;
  display: inline-block;
  font-size: 16px;
  width: calc(100% - 60px);
  text-align: center;
  margin-left: 20px;
  color: white;
  cursor: inherit;
}

.step_bar_num {
  position: absolute;
  margin-top: -7px;
  display: inline-block;
  color: #7099ba;
  border: 2px solid #a1bdd3;
  height: 46px;
  width: 46px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 40px;
  text-align: center;
  z-index: 1;
  right: 0;
  cursor: inherit;
}

.curr_step {
  color: #157ac1;
  background: #157ac1;
  border-color: #157ac1;
}

.pre_zjcl {
  position: fixed;
  background: rgba(0, 0, 0, 0.3);
  top: 74px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.contextmenu {
  position: fixed;
  background: white;
  box-shadow: #8f8f8f 0 0 9px 1px;
}

.contextmenu div {
  font-size: 16px;
  height: 32px;
  line-height: 32px;
  width: 120px;
  border: 1px #ddd solid;
  padding-left: 12px;
  padding-right: 12px;
}

.contextmenu div:hover {
  background: #288ed3;
  color: white;
}

.name_list {
  vertical-align: middle !important;
}

.name_list::selection {
  background: rgba(0, 0, 255, 1);
  color: white;
}

.name_list:focus {
  cursor: auto !important;
}

.icon {
  width: 18px;
  height: 18px;
  vertical-align: middle !important;
}

.el-table td, .el-table th {
  padding: 0px 0;
}

.file_count {
  position: absolute;
  bottom: 10px;
  left: 0;
  font-size: 14px;
}

</style>